!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MiniWebSvr - 个人Web服务器</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            padding: 40px 20px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            margin-bottom: 30px;
        }

        h1 {
            color: #4a5568;
            margin-bottom: 10px;
            font-size: 2.5rem;
        }

        .subtitle {
            color: #718096;
            font-size: 1.2rem;
            margin-bottom: 20px;
        }

        .student-info {
            background: #edf2f7;
            padding: 15px;
            border-radius: 8px;
            display: inline-block;
            margin: 10px 0;
        }

        .card-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 25px;
            margin-bottom: 30px;
        }

        .card {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        }

        .card h2 {
            color: #4a5568;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }

        .card h2 i {
            margin-right: 10px;
            font-size: 1.5rem;
        }

        .card p {
            color: #718096;
            margin-bottom: 20px;
        }

        .btn {
            display: inline-block;
            background: #667eea;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            font-weight: bold;
            transition: background 0.3s ease;
        }

        .btn:hover {
            background: #5a6fd8;
        }

        .server-status {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            margin-bottom: 30px;
        }

        .status-item {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid #e2e8f0;
        }

        .status-item:last-child {
            border-bottom: none;
        }

        .status-label {
            font-weight: bold;
            color: #4a5568;
        }

        .status-value {
            color: #718096;
        }

        .status-value.online {
            color: #38a169;
            font-weight: bold;
        }

        footer {
            text-align: center;
            padding: 20px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            color: #718096;
        }

        @media (max-width: 768px) {
            .card-container {
                grid-template-columns: 1fr;
            }

            h1 {
                font-size: 2rem;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <header>
        <h1>MiniWebSvr</h1>
        <p class="subtitle">轻量级Java Web服务器</p>
        <div class="student-info">
            <p><strong>开发者:</strong> 李明燊 | <strong>学号:</strong> 222024321072047</p>
        </div>
    </header>

    <div class="server-status">
        <h2>服务器状态</h2>
        <div class="status-item">
            <span class="status-label">服务器状态:</span>
            <span class="status-value online">运行中</span>
        </div>
        <div class="status-item">
            <span class="status-label">服务器版本:</span>
            <span class="status-value">MiniWebSvr/1.0</span>
        </div>
        <div class="status-item">
            <span class="status-label">运行端口:</span>
            <span class="status-value">8080</span>
        </div>
        <div class="status-item">
            <span class="status-label">Web根目录:</span>
            <span class="status-value">webroot</span>
        </div>
        <div class="status-item">
            <span class="status-label">启动时间:</span>
            <span class="status-value" id="startup-time">正在加载...</span>
        </div>
    </div>

    <div class="card-container">
        <div class="card">
            <h2><i>🕒</i> 时间服务</h2>
            <p>获取服务器当前时间，展示服务器时间处理能力。</p>
            <a href="/time" class="btn">查看时间</a>
        </div>

        <div class="card">
            <h2><i>🔄</i> 回显服务</h2>
            <p>测试请求参数处理，回显您发送的所有参数和请求头信息。</p>
            <a href="/echo?name=李明燊&id=222024321072047&test=hello" class="btn">测试回显</a>
        </div>

        <div class="card">
            <h2><i>📁</i> 静态资源</h2>
            <p>访问服务器上的静态文件，支持HTML、CSS、JavaScript、图片等。</p>
            <a href="/" class="btn">刷新页面</a>
        </div>
    </div>

    <div class="card">
        <h2><i>⚙️</i> 服务器信息</h2>
        <p>MiniWebSvr 是一个基于Java开发的轻量级Web服务器，支持静态资源服务、动态请求处理和自定义路由。</p>
        <p><strong>功能特性:</strong></p>
        <ul style="margin-left: 20px; margin-bottom: 15px; color: #718096;">
            <li>多线程请求处理</li>
            <li>静态文件服务</li>
            <li>动态请求路由</li>
            <li>参数解析与处理</li>
            <li>自定义处理器扩展</li>
        </ul>
        <p>此项目为Java Web开发课程作业，展示了Web服务器的基本工作原理和实现。</p>
    </div>

    <footer>
        <p>© 2023 MiniWebSvr - 222024321072047 李明燊 - Java Web开发课程作业</p>
    </footer>
</div>

<script>
    // 设置启动时间
    document.getElementById('startup-time').textContent = new Date().toLocaleString('zh-CN');

    // 添加简单的交互效果
    document.querySelectorAll('.btn').forEach(btn => {
        btn.addEventListener('click', function(e) {
            if (this.getAttribute('href') === '#') {
                e.preventDefault();
                alert('此功能正在开发中...');
            }
        });
    });

    // 控制台欢迎信息
    console.log('欢迎访问 MiniWebSvr!');
    console.log('开发者: 李明燊 (222024321072047)');
    console.log('服务器运行在: http://localhost:8080/');
</script>
</body>
</html>